package cn.cs.service.impl;

import cn.cs.client.*;
import cn.cs.common.*;
import cn.cs.pojo.*;
import cn.cs.service.AppOrderService;
import com.alibaba.fastjson.JSON;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.MessageDeliveryMode;
import org.springframework.amqp.core.MessagePostProcessor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.jms.Message;
import javax.jms.ObjectMessage;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;

@Component
public class AppOrderServiceImpl implements AppOrderService {
    @Resource
    private RestAppOrderClient restAppOrderClient;
    @Resource
    private RestRepairUserClient restRepairUserClient;
    @Resource
    private RedisUtils redisUtils;
    @Resource
    private RestRepOrderClient restRepOrderClient;

    @Resource
    private RestRepairOrderClient restRepairOrderClient;

    @Resource
    private RestFaultTypeClient restFaultTypeClient;

    @Resource
    private RabbitTemplate rabbitTemplate;

    @Resource
    private RestUserAddressClient userAddressClient;

    @Resource
    private RestClientUserClient clientUserClient;

    @Resource
    private CommonRpc commonRpc;
    @Override
    public Dto sendAppOrderMessage(String appId, HttpServletRequest request) {
        String token = request.getHeader("token");
        RepairUser user = JSON.parseObject(redisUtils.getString(token), RepairUser.class);
        AppOrder appOrder =  restAppOrderClient.getAppOrderById(appId);
        String orderStete = appOrder.getOrder_state();
        if(!"0".equals(orderStete)){
            return  DtoUtil.returnFail("此订单不是可接单状态，请刷新","002");
        }

        RepairUser u = restRepairUserClient.getRepairUserByPhone(user.getPhone());
        String secodeFT =  restAppOrderClient.getParentFaultType(appOrder.getFault_category());
        String[] sMor = u.getFaultType().split(",");
        boolean flage= false;
        for(String s:sMor){
            if(s.equals(secodeFT)){
                flage = true;
                break;
            }
        }
        if(flage == false){
            return  DtoUtil.returnFail("此订单不在您的服务范围内，无法接单","002");
        }
//        RepOrder   restRepOrderClient.getRepOrderByAppOrderId();
        BookOrderMessageVo bookOrderMessage=new BookOrderMessageVo();
        bookOrderMessage.setWorkerId(user.getId());
        bookOrderMessage.setBookId(appId);
        bookOrderMessage.setUserId(appOrder.getUser_id());

        try {
            //加入排队队列前检查是否已经被抢单
            if("0".equals(appOrder.getIs_protect())){
                if("1".equals(appOrder.getOrder_state())){
                    return DtoUtil.returnFail("该预约已经被抢单", "003");
                }
            }
            //如果未抢单则加入消息队列，等待处理
            //判断成功发送抢单消息 进行排队
            rabbitTemplate.convertAndSend(Constants.RabbitQueueName.TOPIC_EXCHANGE, "key.toQd", bookOrderMessage,new MessagePostProcessor() {
                @Override
                public org.springframework.amqp.core.Message postProcessMessage(org.springframework.amqp.core.Message message) throws AmqpException {
                    //设置消息持久化，避免消息服务器挂了重启之后找不到消息
                    message.getMessageProperties().setDeliveryMode(MessageDeliveryMode.PERSISTENT);
                    return message;
                }
            });
        } catch (Exception e) {
            e.printStackTrace();
            return DtoUtil.returnFail("排队失败", "0002");
        }
        return DtoUtil.returnSuccess();
    }

    @Override
    public Dto getAppOrdersInfo(HttpServletRequest request) throws Exception{
        String token = request.getHeader("token");
        RepairUser user = JSON.parseObject(redisUtils.getString(token), RepairUser.class);
        if(EmptyUtils.isEmpty(user)){
            return DtoUtil.returnFail("用户未登录","0001");
        }
        Map<String,Object> param = new HashMap<String, Object>();
        List<Map<String,Object>> list = restRepairUserClient.getRepairUserArea(user.getId());
        String [] strs = new String[list.size()];
        for (int n =0;n<list.size();n++){
            strs[n]=list.get(n).get("area").toString();
        }
        param.put("areas", strs);
        param.put("rep_user_id",user.getId());
        param.put("faults",user.getFaultType().toString().split(","));
        List<AppOrder> orders = restAppOrderClient.getAllAppOrders(param);
        List<AfterOrder> afterOrders = restAppOrderClient.getAllAfterOrders(user.getId().toString());
        Map<String,Object> retMap = new HashMap<String,Object>();
        if(EmptyUtils.isNotEmpty(afterOrders)){
            String s[] = afterOrders.get(0).getLimitTime().toString().split(" ");
            String da = "";
            int m = 0;
            for(String n:s){
                m = m+1;
                if(m ==2){
                    da = da+" "+n;
                }else{
                    da = da +n;
                }
            }
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
            Date date = simpleDateFormat.parse(da);
            long ts = date.getTime();
            retMap.put("limitTime",ts);
            retMap.put("afterOrders",afterOrders);
        }else{
            retMap.put("limitTime","");
            afterOrders = new ArrayList<AfterOrder>();
            retMap.put("afterOrders",afterOrders);
        }
        retMap.put("appOrders",orders);
        if(EmptyUtils.isNotEmpty(orders) || EmptyUtils.isNotEmpty(afterOrders)){
            return DtoUtil.returnDataSuccess(retMap);
        }else{
            return DtoUtil.returnFail("预约单不存在", "3002");
        }
    }

    @Override
    public Dto dqcUpdateOrderTime(HttpServletRequest request) {
        String token = request.getHeader("token");
        RepairUser user = JSON.parseObject(redisUtils.getString(token), RepairUser.class);
        if(EmptyUtils.isEmpty(user)){
            return DtoUtil.returnFail("用户未登录","0001");
        }
        String order_date = request.getParameter("order_date");
        String order_time = request.getParameter("order_time");
        if(order_date.length() == 8){
            order_date = order_date.replace("-","-0");
        }
        if(order_date.length() == 9){
            order_date = order_date.replaceFirst("-","-0");
        }
        if(order_date.length() == 11){
            order_date = order_date.replace("年","-").replace("月","-").replace("日","");
        }
        if(order_date.length() == 10){
            order_date = order_date.replace("年","-0").replace("月","-").replace("日","");
        }
        String id = request.getParameter("id");
        AppOrder appOrder = new AppOrder();
        appOrder.setId(id);
        appOrder.setOrder_date(order_date);
        appOrder.setOrder_time(order_time);
        int n =   restAppOrderClient.updateAppOrder(appOrder);
        if(n>0){
            RepOrder repOrder = restRepOrderClient.getRepOrderByAppOrderId(id);
            Map<String,Object> map = new HashMap<String, Object>();
            map.put("orderId",repOrder.getId());
            map.put("type","2");
            HttpUtil.doPost("https://www.zzzsyh.com/cs_pay/send_template",map);
            commonRpc.sendAlertInfo(order_date.substring(5,order_date.length()).replace("-","月")+"号"+order_time,appOrder.getUser_phone());
            return  DtoUtil.returnSuccess("提交成功");
        }else{
            return DtoUtil.returnFail("更改时间失败", "002");
        }
    }

    @Override
    public Dto getAppOrderInfo(String appOrderId, HttpServletRequest request) {
        String token = request.getHeader("token");
        RepairUser user = JSON.parseObject(redisUtils.getString(token), RepairUser.class);
        if(EmptyUtils.isEmpty(user)){
            return DtoUtil.returnFail("用户未登录","001");
        }
      AppOrder appOrder = restAppOrderClient.getAppOrderById(appOrderId);
        if(EmptyUtils.isEmpty(appOrder)){
            String userAddressId = appOrder.getUser_address_id();
            String fulladdress = restAppOrderClient.getUserFullAddressByid(userAddressId);
            appOrder.setUser_address(fulladdress);
            return DtoUtil.returnFail("预约单不存在", "002");
        }else{
            return DtoUtil.returnDataSuccess(appOrder);
        }
    }

    @Override
    public Dto refuseAppOrder(HttpServletRequest request) {
        String token = request.getHeader("token");
        RepairUser user = JSON.parseObject(redisUtils.getString(token), RepairUser.class);
        if(EmptyUtils.isEmpty(user)){
            return DtoUtil.returnFail("用户未登录","0001");
        }
        String appId = request.getParameter("appId");
        AppOrder appOrder = restAppOrderClient.getAppOrderById(appId);
        if(EmptyUtils.isNotEmpty(appOrder)){
            appOrder.setOrder_state("0");
            appOrder.setIsprivate_work("0");
            int n = restAppOrderClient.updateAppOrder(appOrder);
            if(n>0){
                return  DtoUtil.returnSuccess();
            }else{
                return DtoUtil.returnFail("更改失败","004");
            }
        }else{
            return DtoUtil.returnFail("预约单不存在","002");
        }
    }



    public Map<String,Object> getAppOrderByAppOrderId(String id)throws Exception{
        Map<String,Object> map = restAppOrderClient.getAppOrderByAppOrderId(id);
        String orderId = "";
        map.put("afterSale", "0");
        try{
            orderId = map.get("orderId").toString();
            String rep_user_id = String.valueOf(map.get("rep_user_id"));
            RepairUser repairUser = restRepairUserClient.getRepairUserById(rep_user_id);
            if(EmptyUtils.isNotEmpty(repairUser)){
                map.put("personName", repairUser.getPersonName());map.put("phone", repairUser.getPhone());
            }else{
                map.put("personName", "");map.put("phone", "");
            }
            List<AfterOrder> afterOrderList = restRepairOrderClient.getAfterOrderByOrderId(orderId);
            if(afterOrderList.size() > 0){
                String state = afterOrderList.get(0).getState();
                if("0".equals(state) || "1".equals(state)){
                    map.put("afterSale", "1");
                }else{
                    map.put("afterSale", "2");
                }
            }else{
                map.put("afterSale", "0");
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return map;
    }


    public Integer itriptxAddAppOrder(AppOrder appOrder)throws Exception{
        return restAppOrderClient.itriptxAddAppOrder(appOrder);
    }

    public Integer modifyAppOrder(AppOrder appOrder)throws Exception{
        return restAppOrderClient.updateAppOrder(appOrder);
    }

    public Map<String, Object> getRepUserIdByAppOrderId(String id)throws Exception{
        return restAppOrderClient.getAppOrderByAppOrderId(id);
    }

    public Integer itriptxDeleteAppOrderById(Long id)throws Exception{
        return restAppOrderClient.itriptxDeleteAppOrderById(id);
    }
    @Override
    public List<UserAddress> getUserAddressListById(Map<String,Object> param)throws Exception{
        return restAppOrderClient.getUserAddressListById(param);
    }


    @Override
    public AppOrder getAppOrderById(String id) throws Exception {
        return restAppOrderClient.getAppOrderById(id);
    }


    @Override
    public Dto registerAppOrder(HttpServletRequest request) throws Exception {
        String userId = request.getParameter("userId");
        if(EmptyUtils.isEmpty(userId)){
            return DtoUtil.returnFail("用户不存在，请重新授权登陆", "userNull001");
        }
        String id = IdWorker.getId();
        String userAddressId = request.getParameter("userAddressId");
        String orderDate = request.getParameter("orderDate");

        String orderTime = request.getParameter("orderTime");
        String hasElevator=request.getParameter("hasElevator");
        String floorNumber=request.getParameter("floorNumber");
        String faultType = request.getParameter("faultType");
        String faultCategory = request.getParameter("faultCategory");
        String faultComment = request.getParameter("faultComment");
        String isprivateWork=request.getParameter("isprivateWork");
        String createTime=DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
        String userType = request.getParameter("userType");
        String is_protect = request.getParameter("is_protect");
        String commonFailures = request.getParameter("common_failures"); //常见故障
        String product_source = request.getParameter("product_source"); //电器厂，保内（维修），谁提供配件 1厂家提供 2维修工提供
        String fixed_price = request.getParameter("fixed_price"); //电器厂，保内 一口价
        String repairNumber = request.getParameter("repairNumber");
        AppOrder appOrder=new AppOrder();
        appOrder.setId(id);
        appOrder.setUserId(userId);
        appOrder.setCommonFailures(commonFailures);
        appOrder.setProductSource(product_source);
        if(EmptyUtils.isNotEmpty(fixed_price)) {
            appOrder.setFixedPrice(Double.valueOf(fixed_price));
        }


        //预约日期  -- 转变为时间
        if("今天".equals(orderDate)){
            appOrder.setOrderDate(DateUtil.format(new Date(),"yyyy-MM-dd"));
        }else if ("明天".equals(orderDate)){
            appOrder.setOrderDate(DateUtil.getFetureDate(1));
        }else if ("后天".equals(orderDate)){
            appOrder.setOrderDate(DateUtil.getFetureDate(2));
        }
        //appOrder.setOrderDate(orderDate);
        appOrder.setOrderTime(orderTime);
        appOrder.setFloorNum(floorNumber);
        appOrder.setFaultType(faultType);
        appOrder.setFaultCategory(faultCategory);
        appOrder.setHasElevator(hasElevator);
        appOrder.setIsprivateWork(isprivateWork);
        appOrder.setFaultComment(faultComment);
        appOrder.setCreateTime(createTime);
        appOrder.setOrderState("0");
        appOrder.setIs_again_order("0");

        String areaId = "";
        String clientRepairId = "";
        UserAddress address=new UserAddress();
        String addressId = IdWorker.getId();
        switch (userType){
            case"0"://个人用户




                Map<String, Object> map = new HashMap<String, Object>();
                map.put("id", userAddressId);
                UserAddress userAddress = getUserAddressListById(map).get(0);
                appOrder.setUserAddress(userAddress.getProvinceName() + userAddress.getCityName() + userAddress.getAreaName() +" "+ userAddress.getAddressContent());
                appOrder.setUserName(userAddress.getUserName());
                appOrder.setUserPhone(userAddress.getUserPhone());
                appOrder.setUserType(userType);
                appOrder.setRepairNumber(Integer.valueOf(repairNumber));

                //企业信息，地址保存
                address.setId(addressId);
                //address.setUserId(userId);
                address.setUserName(userAddress.getUserName());
                address.setUserPhone(userAddress.getUserPhone());
                address.setAddressContent(userAddress.getAddressContent());
                address.setProvince(userAddress.getProvince());
                address.setCity(userAddress.getCity());
                address.setArea(userAddress.getArea());
                appOrder.setUserAddressId(addressId);
                address.setCreateTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
                userAddressClient.itriptxAddUserAddress(address);


                areaId = userAddress.getArea();
                if("1".equals(isprivateWork)){//选中私人维修工
                    Map<String, Object> param = new HashMap<String, Object>();
                    param.put("clientUserId", userId);
                    List<ClientRepRel> clientRepRels = clientUserClient.getClientRepRelListByMap(param);
                    if(clientRepRels.size() > 0){//私人维修工是否存在
                        RepairUser repairUser = restRepairUserClient.getRepairUserById(clientRepRels.get(0).getRepUserId());
                        if(repairUser != null && "0".equals(repairUser.getWorkstate())){
                            return DtoUtil.returnFail("申请失败，私人维修工正在休息中，请勿勾选私人维修工选项","0003");
                        }
                        Map<String, Object> objectMap = restRepairUserClient.getRepairUserAddressByAreaId(clientRepRels.get(0).getRepUserId(), areaId);
                        if(EmptyUtils.isEmpty(objectMap)){
                            return DtoUtil.returnFail("申请失败，您的私人维修工不负责所在区域","004");
                        }
                        String fault_type_id = repairUser.getFaultType();
                        FaultType faultType1 = restFaultTypeClient.getFaultTypeByOnlyId(faultCategory);
                        String parentId = faultType1.getParentId();
                        boolean isTrue = false;
                        if(fault_type_id != null){
                            String faustTypeIds[] = fault_type_id.split(",");
                            for(String a:faustTypeIds){
                                if(parentId.equals(a) || faultCategory.equals(a) ){
                                    isTrue = true;
                                    break;
                                }
                            }
                        }
                        if(!isTrue){
                            return DtoUtil.returnFail("申请失败，私人维修工无法完成您所选中的维修","0004");
                        }

                        clientRepairId = clientRepRels.get(0).getRepUserId();
                    }else{
                        return DtoUtil.returnFail("申请失败，您没有私人维修工","005");
                    }
                }


                break;
            case"1": case"2"://1企业用户   2电器厂家用户
                String companyName = request.getParameter("companyName");
                String userName = request.getParameter("userName");
                String userPhone = request.getParameter("userPhone");
                String province = request.getParameter("province");
                String city = request.getParameter("city");
                String area = request.getParameter("area");
                String provinceName = request.getParameter("provinceName");
                String cityName = request.getParameter("cityName");
                String areaName = request.getParameter("areaName");
                String addressContent = request.getParameter("addressContent");
                areaId = area;

                //企业信息，地址保存
                address.setId(addressId);
                //address.setUserId(userId);
                address.setUserName(userName);
                address.setUserPhone(userPhone);
                address.setAddressContent(addressContent);
                address.setProvince(province);
                address.setCity(city);
                address.setArea(area);
                address.setCreateTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
                userAddressClient.itriptxAddUserAddress(address);
                //地址拼接 - 存入预约订单
                appOrder.setUserAddress(provinceName + cityName + areaName +" "+ addressContent);
                appOrder.setUserName(userName);
                appOrder.setUserPhone(userPhone);
                appOrder.setUserType(userType);
                appOrder.setUserAddressId(addressId);
                if("1".equals(userType)){
                    appOrder.setRepairNumber(Integer.valueOf(repairNumber));
                }else{
                    appOrder.setRepairNumber(1);
                    if(!"2".equals(is_protect)){
                        appOrder.setIs_protect(is_protect);
                    }
                }
                appOrder.setCompanyName(companyName);

                // 厂家名称存入clientUser表里
                ClientUser clientUser = new ClientUser();
                clientUser.setId(userId);
                clientUser.setCompanyName(companyName);
                clientUserClient.updateClientUser(clientUser);
                break;

        }
        // 发送极光推送给维修工
        String[] strSelect = new String[1];
        Map<String, String> cmap = new HashMap<String, String>();
        cmap.put("subscribeId", id);
        if(!EmptyUtils.isEmpty(clientRepairId)){//私人维修工
            strSelect[0] = clientRepairId;
            Object obj = JPushUtil.testSendPush(strSelect, "您有新的预约订单，请查看", cmap);
            System.out.println(obj);
        }else{//区域内维修工
//            List<Map<String, Object>> list = repUserAddressMapper.getRepairUserIdByAreaId(areaId);
            List<Map<String, Object>> list =restRepairUserClient.getRepairUserByAreaId(areaId);
            if(list.size() > 0){
                strSelect = new String[list.size()];
                for(int i=0;i<list.size();i++){
                    strSelect[i] = list.get(i).get("id").toString();
                }
                Object obj = JPushUtil.testSendPush(strSelect, "您有新的预约订单，请查看", cmap);
                System.out.println(obj);
            }
        }



        int  n = restAppOrderClient.itriptxAddAppOrder(appOrder);
        if(n>0){
            return DtoUtil.returnSuccess("提交成功","true");
        }else{
            return DtoUtil.returnFail("创建失败","002");
        }

    }

    //判断能否下单给私人维修工
    @Override
    public Dto privateWorker(HttpServletRequest request) throws Exception {
        String userId = request.getParameter("userId");
        String userAddressId = request.getParameter("userAddressId");
        String faultCategory = request.getParameter("faultCategory");

        String areaId = "";
        Map<String, Object> map = new HashMap<>();
        map.put("id", userAddressId);
        UserAddress userAddress = getUserAddressListById(map).get(0);
        areaId = userAddress.getArea();
        Map<String, Object> param = new HashMap<>();
        param.put("clientUserId", userId);
        List<ClientRepRel> clientRepRels = clientUserClient.getClientRepRelListByMap(param);
        if(clientRepRels.size() > 0){//私人维修工是否存在
            RepairUser repairUser = restRepairUserClient.getRepairUserById(clientRepRels.get(0).getRepUserId());
            if(repairUser != null && "0".equals(repairUser.getWorkstate())){
                return DtoUtil.returnFail("私人维修工正在休息中，请勿勾选私人维修工选项","0003");
            }
            Map<String, Object> objectMap = restRepairUserClient.getRepairUserAddressByAreaId(clientRepRels.get(0).getRepUserId(), areaId);
            if(EmptyUtils.isEmpty(objectMap)){
                return DtoUtil.returnFail("您的私人维修工不负责所在区域","004");
            }
            String fault_type_id = repairUser.getFaultType();
            FaultType faultType1 = restFaultTypeClient.getFaultTypeByOnlyId(faultCategory);
            String parentId = faultType1.getParentId();
            boolean isTrue = false;
            if(fault_type_id != null){
                String faustTypeIds[] = fault_type_id.split(",");
                for(String a:faustTypeIds){
                    if(parentId.equals(a) || faultCategory.equals(a) ){
                        isTrue = true;
                        break;
                    }
                }
            }
            if(!isTrue){
                return DtoUtil.returnFail("私人维修工无法完成您所选中的维修","0004");
            }
        }else{
            return DtoUtil.returnFail("您没有私人维修工","005");
        }
        return DtoUtil.returnSuccess("操作成功","000");

    }

    @Override
    public Dto updateAppOrderStated(HttpServletRequest request, String userId, String orderState) throws Exception {
        AppOrder appOrder=new AppOrder();
        appOrder.setUserId(userId);
        appOrder.setOrderState(orderState);
        restAppOrderClient.updateAppOrder(appOrder);
        return DtoUtil.returnSuccess();
    }

    @Override
    public Dto toRepairOrder(RepOrder repOrder) throws Exception {

        restAppOrderClient.toRepairOrder(repOrder);
        return DtoUtil.returnSuccess();
    }

    @Override
    public Page<Map<String,Object>> queryRepairOrderPageByMap(Map<String, Object> param, Integer pageNo, Integer pageSize) throws Exception {
        Integer total = restAppOrderClient.getAppOrderCountByMap(param);
        pageNo = EmptyUtils.isEmpty(pageNo) ? Constants.DEFAULT_PAGE_NO : pageNo;
        pageSize = EmptyUtils.isEmpty(pageSize) ? Constants.DEFAULT_PAGE_SIZE : pageSize;
        Page page = new Page(pageNo, pageSize, total);
        param.put("beginPos", page.getBeginPos());
        param.put("pageSize", page.getPageSize());
        List<Map<String,Object>> repairOrderList = restAppOrderClient.getAppOrderListByMap(param);
        page.setRows(repairOrderList);
        return page;
    }


    @Override
    public Dto updateFixedPrice(HttpServletRequest request) throws Exception {
        String id = request.getParameter("id");
        String fixed_price = request.getParameter("fixed_price"); //电器厂，保内 一口价

        AppOrder map = restAppOrderClient.getAppOrderById(id);
        if("0".equals(map.getOrder_state())){
            String areaId = map.getArea();
            AppOrder appOrder = new AppOrder();
            appOrder.setId(id);
            appOrder.setFixedPrice(Double.valueOf(fixed_price));
            appOrder.setCreateTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
            // 发送极光推送给维修工
            String[] strSelect = new String[1];
            Map<String, String> cmap = new HashMap<String, String>();
            cmap.put("subscribeId", id);
            //区域内维修工
            List<Map<String, Object>> list =restRepairUserClient.getRepairUserByAreaId(areaId);
            if(list.size() > 0){
                strSelect = new String[list.size()];
                for(int i=0;i<list.size();i++){
                    strSelect[i] = list.get(i).get("id").toString();
                }
                Object obj = JPushUtil.testSendPush(strSelect, "您有新的预约订单，请查看", cmap);
                System.out.println(obj);
            }
            int  n = restAppOrderClient.updateAppOrder(appOrder);
            if(n>0){
                return DtoUtil.returnSuccess("操作成功","true");
            }else{
                return DtoUtil.returnFail("操作失败","002");
            }
        }
        return DtoUtil.returnFail("此预约单已被接单，无法修改一口价","003");
    }

    public List<Map<String, Object>> getOverTimeAppOrderList(){
        return restAppOrderClient.getOverTimeAppOrderList();
    }

    public List<Map<String, Object>> getCourierServices(){
        return restAppOrderClient.getCourierServices();
    }

    public Integer saveCourierServices(String courierCompany, String courierNumber, String id){
        return restAppOrderClient.saveCourierServices(courierCompany, courierNumber, id);
    }

}
